library(frequency)
library(dplyr)
library(tidyverse)
install.packages("readxl")
library(readxl)

Pforecast <- read_excel("enter file path here")
Hforecast<-read_excel("enter file path here")

Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=Pforecast)
summary(Pres)
new <- data.frame(NYWorseJ=c(22), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1956, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(6), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1960, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(5), LogTWH=c(2.079441542))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1964, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(5), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1968, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(9), LogTWH=c(2.079441542))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1972, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(6), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1976, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(12), LogTWH=c(2.079441542))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1980, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(25), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1984, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(11), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1988, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(10), LogTWH=c(2.079441542))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1992, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(10), LogTWH=c(2.48490665))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 1996, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(9), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 2000, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(6), LogTWH=c(2.079441542))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 2004, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(11), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 2008, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(25), LogTWH=c(2.079441542))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 2012, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(15), LogTWH=c(1.386294361))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 2016, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(9), LogTWH=c(2.079441542))
predict(Pres, newdata=new)

data_subset <- Pforecast[Pforecast$Year != 2020, ]
Pres <- lm(Inc ~ NYWorseJ + LogTWH, data=data_subset)
summary(Pres)
new <- data.frame(NYWorseJ=c(8), LogTWH=c(1.386294361))
predict(Pres, newdata=new)



House <- lm(Hchange ~ NYWorseJ + OpenInt, data=Hforecast)
summary(House)
new <- data.frame(NYWorseJ=c(22), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1954, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(9), OpenInt=c(-30))
predict(House, newdata=new)


data_subset <- Hforecast[Hforecast$Year != 1956, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(6), OpenInt=c(27))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1958, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(10), OpenInt=c(-36))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1960, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(5), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1962, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(6), OpenInt=c(-36))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1964, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(5), OpenInt=c(41))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1966, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(12), OpenInt=c(-30))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1968, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(9), OpenInt=c(-28))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1970, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(12), OpenInt=c(-39))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1972, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(6), OpenInt=c(51))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1974, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(22), OpenInt=c(-51))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1976, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(12), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1978, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(23), OpenInt=c(-54))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1980, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(25), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1982, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(18), OpenInt=c(-50))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1984, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(11), OpenInt=c(25))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1986, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(11), OpenInt=c(-43))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1988, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(10), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1990, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(11), OpenInt=c(-28))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1992, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(12), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1994, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(9), OpenInt=c(-52))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1996, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(9), OpenInt=c(51))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 1998, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(6), OpenInt=c(-34))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2000, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(6), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2002, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(6), OpenInt=c(-43))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2004, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(11), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2006, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(13), OpenInt=c(-30))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2008, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(25), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2010, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(3), OpenInt=c(-40))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2012, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(15), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2014, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(15), OpenInt=c(-46))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2016, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(9), OpenInt=c(0))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2018, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(11), OpenInt=c(-56))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2020, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(3), OpenInt=c(-40))
predict(House, newdata=new)

data_subset <- Hforecast[Hforecast$Year != 2022, ]
House <- lm(Hchange ~ NYWorseJ + OpenInt, data=data_subset)
summary(House)
new <- data.frame(NYWorseJ=c(32), OpenInt=c(-49))
predict(House, newdata=new)
